package com.tmt.im.manager.controller.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;

import java.io.Serial;
import java.io.Serializable;

/**
 * @Description TODO
 * @Author wuyi
 * @Date 2024/9/5 20:16
 * @Version 1.0
 **/
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Tag(name = "SlideQueryRequest", description = "滑动查询请求对象")
public class SlideQueryRequest implements Serializable {

    @Serial
    private static final long serialVersionUID = -2517328054809754835L;

    @Schema(description = "滑动查询的起始位置，如果值等于0时，使用Long类型的最大值替换之。")
    @NotNull
    @Min(value = 0, message = "起始位置不能小于0")
    private Long startId;

    @Schema(description = "滑动查询的方向; true表示向最新数据方向滑动，false表示向更早数据方向滑动")
    @NotNull(message = "滑动查询方向不能为null")
    private Boolean backward;

    @Schema(description = "期望返回的数据记录数量")
    @NotNull(message = "期望返回的数据记录数量不能为null")
    @Min(value = 1, message = "期望返回的数据记录数不能少于1")
    private Integer windowSize;
}